#
#	Foundation tests Makefile
# 
TOP = ../..

# List of Tools to build
TOOLS = \
nsarchiver \
nsarray \
nsattributedstring \
nsbundle \
nsdata \
nsdate \
nsdictionary \
nsfilemanager \
nshashtable \
nsmaptable \
nsnotification \
nsprocessinfo \
nsscanner \
nsset \
nstask \
nstimer \
string \
nsauto \
values \
#diningPhilosophers \

# List of bundles to build
BUNDLES = \
LoadMe 

# Files to be compiled for each bundle
LoadMe_FILES = LoadMe.m

TOOL_LIBS =	-L$(_TOP)/Foundation/DO/$(OBJS_DIR) -lGdo \
		-lm -ldl -lpthread \
		-L/Developer/Zaurus-X-gcc/SDKs/mySTEP.sdk/usr/ffcall/lib -lavcall \
		-lobjc

#
#	Include Makefiles 
# 
include $(TOP)/Makefiles/tool.make
include $(TOP)/Makefiles/bundle.make

#
#	Run all of the tests 
# 
run::
	@(LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:../Source/$(OBJS_DIR); \
		export LD_LIBRARY_PATH; \
		for test in $(TOOLS); do \
		echo "#"; \
		echo "#  running $$test test"; \
		echo "#"; \
		./$$test; \
	done)

baseline::
	@(LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:../Source/$(OBJS_DIR); \
		export LD_LIBRARY_PATH; \
		for test in $(TOOLS); do \
		echo "#"; \
		echo "#  running $$test test"; \
		echo "#"; \
		./$$test >$$test.baseline 2>&1 ; \
	done)

regress::
	@(LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:../Source/$(OBJS_DIR); \
		export LD_LIBRARY_PATH; \
		for test in $(TOOLS); do \
		echo "#"; \
		echo "#  running $$test test"; \
		echo "#"; \
		./$$test >$$test.out 2>&1 ; \
		diff -c2 $$test.baseline $$test.out >regress.out && echo passed || \
		echo failed; \
	done)

#
# General Rules
#
distclean::
	rm -rf *.out *.baseline

